<%--
  Created by IntelliJ IDEA.
  User: BM
  Date: 2024/7/20
  Time: 22:15
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>书籍展示</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
          integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <style>
        .content {
            width: 80%;
            margin: auto;
        }

        .addBook {
            margin-top: 30px;
            float: right;
        }
        .flex{
            /*display: flex;*/
            /*align-items: center;*/
        }
        .ml15{
            margin-left: 15px;
        }
    </style>
</head>
<body>
<div class="content">
    <div class="addBook">
        <a class="btn btn-primary" href="${pageContext.request.contextPath}/book/bookFrom" role="button">新增</a>
        <a class="btn btn-primary" href="${pageContext.request.contextPath}/file/uploadIndex" role="button">文件上传</a>
    </div>

    <table class="table">
        <thead>
        <tr>
            <th scope="col" width="150">书名</th>
            <th scope="col" width="120">类型</th>
            <th scope="col" width="80">作者</th>
            <th scope="col">描述</th>
            <th scope="col" width="150">出版社</th>
            <th scope="col" width="180">操作</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach var="book" items="${list}">
            <tr>
                <td>${book.name}</td>
                <td>${book.type}</td>
                <td>${book.auther}</td>
                <td>${book.describe}</td>
                <td>${book.publisher}</td>
                <td class="flex">
                    <a class="btn btn-primary" href="${pageContext.request.contextPath}/book/bookFrom?id=${book.id}" role="button">编辑</a>
                    <a class="btn btn-danger ml15" href="${pageContext.request.contextPath}/book/delete?id=${book.id}" role="button">删除</a>
                </td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
</div>
</body>
</html>
